import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/admin/sysgrayitem/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/admin/sysgrayitem',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/admin/sysgrayitem/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/admin/sysgrayitem/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/admin/sysgrayitem',
    method: 'put',
    data: obj
  })
}

//------------关系--------------
export function fetchItemList(query) {
  return request({
    url: '/admin/sysfrontgray/page',
    method: 'get',
    params: query
  })

}

export function bindFrontGray(obj) {
  return request({
    url: '/admin/sysfrontgray/bind',
    method: 'post',
    data: obj
  })
}

export function delFrontGray(id) {
  return request({
    url: '/admin/sysfrontgray/' + id,
    method: 'delete'
  })
}
